// TypeScript file
class ProfileUI extends eui.Component
{
    constructor()
    {
        super();
        this.addEventListener(eui.UIEvent.COMPLETE, this.uiCompHandler, this);
        this.skinName = profileUISkin;
    }

    private uiCompHandler(evt : eui.UIEvent) : void
    {
        //返回按钮
        this.btnReturn.addEventListener(egret.TouchEvent.TOUCH_TAP, () => 
        {
            this.dispatchEventWith( GameEvents.EVT_RETURN );
        }, this);
        //强化按钮
        //装备按钮
        //填充数据
        this.fillData();
    }

    private fillData() : void
    {
        var dsListSkills : Array<Object> = 
        [
            { icon : "skillIcon01_png", name : "旋龙幻杀" },
            { icon : "skillIcon02_png", name : "魔魂天咒" },
            { icon : "skillIcon03_png", name : "天魔舞" },
            { icon : "skillIcon04_png", name : "痴情咒" },
            { icon : "skillIcon05_png", name : "无间寂" },
            { icon : "skillIcon06_png", name : "霸天戮杀" },
            { icon : "skillIcon07_png", name : "灭魂狂飙" }
        ];

        this.listSkills.dataProvider = new eui.ArrayCollection(dsListSkills);
        this.listSkills.itemRenderer = ProfileSkillListIRSkin;
    }

    private btnReturn : eui.Button;
    private btnEquip : eui.Button;
    private btnStrengthen : eui.Button;
    private scrListSkills : eui.Scroller;
    private listSkills : eui.List;
}

class ProfileSkillListIRSkin extends eui.ItemRenderer
{
    constructor()
    {
        super();
        this.skinName = profileSkillListIRSkin;
    }

    protected createChildren() : void
    {
        super.createChildren();
    }
}